<!DOCTYPE HTML>
<HTML>

<HEAD>
    <SCRIPT type="text/javascript">
        function OnClick111() {
            alert("A click event has occurred on the Submit button.");
        }

        // 给sbumit按钮添加click事件监听
        function AddEventHandler() {
            var Button = document.getElementById("Button");
            if (Button.addEventListener) {
                Button.addEventListener("click", OnClick111, false);
            }
        }
        // 删除sbumit按钮的click事件监听
        function RemoveEventHandler() {
            var Button = document.getElementById("Button");
            if (Button.removeEventListener) {
                Button.removeEventListener("click", OnClick, false);
            }
        }
    </SCRIPT>
</HEAD>

<BODY>
    Click on the Submit button when the 'click' event has a listener and when it does not.
    <br />
    <button onclick="AddEventHandler();">Add a 'click' event listener to the Submit button</button>
    <button onclick="RemoveEventHandler();">Remove the event listener</button>
    <br />
    <br />
    <button id="Button">Submit</button>
</BODY>

</HTML>